import os

import pygame

def loadImage(path, colorkey=(127, 127, 127)):
    image = pygame.image.load(path)
    image = image.convert()
    if colorkey is not None:
        if colorkey is -1:
            colorkey = image.get_at((0,0))
        image.set_colorkey(colorkey, pygame.RLEACCEL)
    return image